import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
import CenterView from "@/views/user/CenterView.vue";

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        redirect: '/jots',
        children: [
            {path: '/jots', component: () => import('../views/home/JOTSView.vue'),},
            {path: '/film', component: () => import('../views/home/FilmView.vue')},
            {path: '/subject', component: () => import('../views/home/SubjectView.vue')},
            {path: '/preview', component: () => import('../views/home/PreviewView.vue')},
            {path: '/details', component: () => import('../views/film/DetailsView.vue')},
            {path: '/subjectDetails', component: () => import('../views/film/SubjectDetailsView.vue')},
            {path: '/watch', component: () => import('../views/film/WatchView.vue')},
            {path: '/director', component: () => import('../views/film/DirectorView.vue')},
            {path: '/watchPreview', component: () => import('../views/film/WatchPreviewView.vue')},
            {path: '/watchPreviewByFilmId', component: () => import('../views/film/WatchPreviewByFilmIdView.vue')},
        ]
    },
    {
        path: '/center',
        name: 'center',
        component: CenterView,
        redirect: '/information',
        children: [
            {path: '/information', component: () => import('../views/user/userAbout/UserInfoView.vue')},
            {path: '/changeAvatar', component: () => import('../views/user/userAbout/ChangeAvatarView.vue')},
            {path: '/comments', component: () => import('../views/user/userAbout/CommentsView.vue')},
            {path: '/records', component: () => import('../views/user/userAbout/RecordsView.vue')},
            {path: '/password', component: () => import('../views/user/userAbout/PasswordView.vue')}
        ]
    },
    {path: '/login', component: () => import('../views/login/LoginView.vue')},
    {path: '/signIn', component: () => import('../views/user/SignInView.vue')},
    {path: '/agreement', component: () => import('../views/user/UserAgreementView.vue')},
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
